package com.jinsi.service.zhu.iml;

import com.jinsi.constant.LhrConstant;
import com.jinsi.constant.TangConstant;
import com.jinsi.mapper.zhu.HomeOverviewMapper;
import com.jinsi.service.zhu.HomeOverviewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


/**
 * 获取主页信息
 * @author 朱浩榕
 * @Date 2022-10-19
 */
@Service
@Transactional
public class HomeOverviewServiceImpl implements HomeOverviewService {

    @Autowired
    private HomeOverviewMapper homeOverviewMapper;

    /**
     * 查询商品已上架的数量
     * @return
     */
    @Override
    public int getCommodityQuantity() {
        int a = homeOverviewMapper.getCommodityQuantity(TangConstant.COMMODITY_END);
        return a;
    }

    /**
     * 查询课程已上架的数量
     * @return
     */
    @Override
    public int getConstantQuantity() {
        int a = homeOverviewMapper.getConstantQuantity(LhrConstant.SHELVES_START);
        return a;
    }

    /**
     * 查询上传的课程视频总量
     * @return
     */
    @Override
    public int getCourseVideo() {
        int a = homeOverviewMapper.getCourseVideo();
        return a;
    }
    /**
     * 查询课程视频点赞总量
     * @return
     */
    @Override
    public int getTotalNumberOfVideoLikes() {
        int a = homeOverviewMapper.getTotalNumberOfVideoLikes();
        return a;
    }

    @Override
    public int getCurrculumCollectionQuantity() {
        int a = homeOverviewMapper.getCurrculumCollectionQuantity();
        return a;
    }

    @Override
    public int getNumberOfAllUsers() {
        return homeOverviewMapper.getNumberOfAllUsers();
    }

    @Override
    public int getCurrentDayUser() {
        return homeOverviewMapper.getCurrentDayUser();
    }

    @Override
    public int getYesterdayUser() {
        return homeOverviewMapper.getYesterdayUser();
    }

    @Override
    public int getUsersOfThisMonth() {
        return homeOverviewMapper.getUsersOfThisMonth();
    }


}
